<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>商品详请</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport"
		content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="../static/css/font.css" />
	<link rel="stylesheet" type="text/css" href="../static/css/weadmin.css" />
	<link rel="stylesheet" type="text/css" href="../lib/layui/css/layui.css" />
	<style type="text/css">
		img {
			width: 150px;
			height: 200px;
			border: 1px solid silver;
		}
	</style>
</head>

<body>
	<div class="weadmin-body" id="app">
		<div class="layui-form">
			<div class="layui-row">
				<div class="layui-col-md12">
					<div class="layui-col-md4 layui-col-md-offset2" style="width: 175px;">
						<div class="layui-input-inline">
							<img :src="goods.defaultItem.image">
						</div>
					</div>
					<div class="layui-col-md7">
						<div v-for="sp in speciList">
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='qzsxt'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" class="layui-input" v-model="goods.map.qzsxt[1]">
										<option :value="op.id" v-for="op in sp.options">{{op.optionName}}</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='hzsxt'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" class="layui-input" v-model="goods.map.hzsxt[1]">
										<option :value="op.id" v-for="op in sp.options">{{op.optionName}}</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='spzl'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" class="layui-input" v-model="goods.map.spzl[1]">
										<option :value="op.id" v-for="op in sp.options">{{op.optionName}}</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='zpcc'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" class="layui-input" v-model="goods.map.zpcc[1]">
										<option :value="op.id" v-for="op in sp.options">{{op.optionName}}</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='cpu'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" class="layui-input" v-model="goods.map.cpu[1]">
										<option :value="op.id" v-for="op in sp.options">{{op.optionName}}</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='xtnh'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" class="layui-input" v-model="goods.map.xtnh[1]">
										<option :value="op.id" v-for="op in sp.options">{{op.optionName}}</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='sim'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" class="layui-input" v-model="goods.map.sim[1]">
										<option :value="op.id" v-for="op in sp.options">{{op.optionName}}</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='dcrl'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" class="layui-input" v-model="goods.map.dcrl[1]">
										<option :value="op.id" v-for="op in sp.options">{{op.optionName}}</option>
									</select>
								</div>
							</div>
						</div>
						<div class="layui-form-item" style="margin: auto;">
							<label class="layui-form-label">
								手机品牌：
							</label>
							<div class="layui-input-inline">
								<select id="brand" class="layui-input" v-model="goods.brandId">
									<option :value="b.id" v-for="b in brandList">{{b.name}}</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item" style="margin: auto;">
							<label class="layui-form-label">
								默认单品：
							</label>
							<div class="layui-input-inline">
								<select id="defaultItem" class="layui-input" v-model="goods.defaultItem.id">
									<option :value="item.id" v-for="item in itemList">{{item.colour}} {{item.edition}}
										{{item.network}}</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item" style="margin: auto;">
							<label class="layui-form-label">
								商品名称：
							</label>
							<div class="layui-input-inline">
								<input class="layui-input" v-model="goods.goodsName">
							</div>
						</div>
						<div class="layui-form-item" style="margin: auto;">
							<label class="layui-form-label">
								市场价格：
							</label>
							<div class="layui-input-inline">
								<input class="layui-input" v-model="goods.price">
							</div>
						</div>
						<div class="layui-form-item" style="margin: auto;">
							<label class="layui-form-label">
								商品标题：
							</label>
							<div class="layui-input-inline">
								<textarea class="layui-input" v-model="goods.title"></textarea>
							</div>
						</div>
						<div class="layui-form-item" style="margin: auto;">
							<label class="layui-form-label">
								商品卖点：
							</label>
							<div class="layui-input-inline">
								<textarea class="layui-input" v-model="goods.sellPoint"></textarea>
							</div>
						</div>
						<div class="layui-form-item" style="margin: auto;">
							<a title="修改" @click="updateGoods">确认修改</a>
							<a title="返回" href="productList.html">返回</a>
						</div>
					</div>
				</div>
			</div>

		</div>
	</div>
	<script src="../lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script src="../static/js/admin.js" type="text/javascript" charset="utf-8"></script>
	<!-- <script src="https://cdn.jsdelivr.net/npm/vue@2"></script> -->
	<script src="../static/js/vue.js"></script>
	<script src="../static/js/axios.js"></script>
	<script src="../static/js/controller/CommonUrl_yh.js"></script>
	<script src="../static/js/controller/product_yh.js"></script>
	<script src="../static/js/service/product_yh.js"></script>
	<script type="text/javascript">
		axios.defaults.baseURL = axios_url.baseURL;
		var vueapp = new Vue({
			el: '#app',
			data: {
				goods: null,			// 商品信息
				speciList: null,		// 规格列表
				brandList: null,		// 品牌列表
				itemList: null,			// 所有单品
			},
			methods: {
				// 查询所有的商品信息
				findGoodsById: product_yh_controller.findGoodsById,
				// 修改单品信息
				updateGoods: product_yh_controller.updateGoods,
				// 规格回显查询
				findSpeciAll: product_yh_controller.findSpeciAll,
				// 品牌回显查询
				findBrandAll: product_yh_controller.findBrandAll,
				// 回显所有单品
				findItemFromGoodsId: product_yh_controller.findItemFromGoodsId,
			},
			created: product_yh_service.createdGoodsDetails,
		})
	</script>
</body>

</html>